<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css"  href="css/bootstrap.min.css"/>
	<link rel="stylesheet" type="text/css" href="js/select2/select2.css" />
	<link rel="stylesheet" href="js/jsilder/css/jslider.css" type="text/css">
	<link rel="stylesheet" href="js/jsilder/css/jslider.blue.css" type="text/css">
	<link rel="stylesheet" href="js/jsilder/css/jslider.plastic.css" type="text/css">
	<link rel="stylesheet" href="js/jsilder/css/jslider.round.css" type="text/css">
	<link rel="stylesheet" href="js/jsilder/css/jslider.round.plastic.css" type="text/css">
	<script type="text/javascript" src="js/jsilder/js/jquery-1.7.1.js"></script>
	<script type="text/javascript" src="js/jsilder/js/jshashtable-2.1_src.js"></script>
	<script type="text/javascript" src="js/jsilder/js/jquery.numberformatter-1.2.3.js"></script>
	<script type="text/javascript" src="js/jsilder/js/tmpl.js"></script>
	<script type="text/javascript" src="js/jsilder/js/jquery.dependClass-0.1.js"></script>
	<script type="text/javascript" src="js/jsilder/js/draggable-0.1.js"></script>
	<script type="text/javascript" src="js/jsilder/js/jquery.slider.js"></script>
	<style type="text/css" media="screen">
		  body{
			padding-top:50px;
			}
		 .layout { padding: 50px; font-family: Georgia, serif; }
		 .layout-slider { margin-bottom: 60px; width: 50%; }
		 .layout-slider-settings { font-size: 12px; padding-bottom: 10px; }
		 .layout-slider-settings pre { font-family: Courier; }
	</style>
	<title>凯胜项目管理系统</title>
</head>
<body class="body">
	<%@include file="same2.jsp" %>
	<div class="container">
		<div class="row">
			<div class="span9">
					<form class="form-horizontal" id="myform" action="task.jspx?tmothed=edit" method="post">
						<fieldset>
						<legend>编辑任务</legend>
						
						<c:choose>
							<c:when test="${sessionScope.userProject.role=='manager'}">
								<div class="control-group">
									<label class="control-label" for="input01">任务名称:</label>
									<div class="controls">
										<input type="text" name="name" class="span5" id="input01" value="${requestScope.task.name}">
										<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
									</div>
								</div>
								<input type="hidden" name="goalid" value="${requestScope.goalid}">
								<input type="hidden" name="id" value="${requestScope.task.id }">
								<div class="control-group">
									<label class="control-label" for="input01">开始时间:</label>
									<div class="controls">
										<input type="text" name="start" class="span5" id="input01" value="${requestScope.task.starttime}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">截止时间:</label>
									<div class="controls">
										<input type="text" name="end" class="span5" id="input01" value="${requestScope.task.endtime}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">任务描述:</label>
									<div class="controls">
									<textarea name="desc" class="span5" id="input01" style="width:500px" rows="5">${requestScope.task.description}</textarea>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">状态:</label>
									<div class="controls">
										<select >
											<option>新任务</option>
											<option>进行中</option>
											<option>已完成</option>
									  </select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">级别:</label>
									<div class="controls">
										<select name="isImport">
											<option>重要紧急</option>
											<option>重要不紧急</option>
											<option>紧急不重要</option>
											<option>不紧急不重要</option>
									  </select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">任务负责人:</label>
									<div class="controls">
										<select name="manager" class="multiSelect" style="width:200px">
							                <c:forEach items="${requestScope.userList}" var="user">
							                	<option value="${user.id }">${user.username }</option>
							                </c:forEach>
							              </select>
									</div>
								</div>
							</c:when>
							<c:otherwise>
								<div class="control-group">
									<label class="control-label" for="input01">任务名称:</label>
									<input type="hidden" name="name" class="span5" id="input01" value="${requestScope.task.name}">
									<div class="controls">
										<div  class="breadcrumb"  style="width:200px;border:1px solid grey；height:8px" >${requestScope.task.name}</div>
									</div>
								</div>
								<input type="hidden" name="goalid" value="${requestScope.goalid}">
								<input type="hidden" name="id" value="${requestScope.task.id }">
								<div class="control-group">
									<label class="control-label" for="input01">开始时间:</label>
									<div class="controls">
										<input type="hidden" name="start" class="span5" id="input01" value="${requestScope.task.starttime}">
										<div  class="breadcrumb"  style="width:200px;border:1px solid grey；height:8px" >${requestScope.task.starttime}</div>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">截止时间:</label>
									<div class="controls">
										<input type="hidden" name="end" class="span5" id="input01" value="${requestScope.task.endtime}">
										<div  class="breadcrumb"  style="width:200px;border:1px solid grey；height:8px" >${requestScope.task.endtime}</div>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">任务描述:</label>
										<input type="hidden" name="desc" class="span5" id="input01" style="width:500px" value="${requestScope.task.description}">
										<div class="controls">
											<div  class="well" id="input01" style="width:500px;border:1px solid grey" >${requestScope.task.description}</div>
										</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">状态:</label>
									<div class="controls">
										<select >
											<option>${requestScope.task.stat}</option>
									  </select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">级别:</label>
									<div class="controls">
										<select name="isImport">
											<option>${requestScope.task.isImport}</option>
									  </select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="input01">任务负责人:</label>
									<div class="controls">
										<select name="manager" class="multiSelect" style="width:200px">
							                	<option value="${sessionScope.userProject.user.id}">${sessionScope.userProject.user.username}</option>
							              </select>
									</div>
								</div>
							</c:otherwise>
						</c:choose>
						
						<c:choose>
							<c:when test="${sessionScope.userProject.role=='manager'}">
								<c:choose>
									<c:when test="${sessionScope.userProject.user.id==requestScope.task.t_user_id}">
										<div class="control-group">
											<label class="control-label" for="input01">当前进度:</label>
											<div style="margin-left:20px;">
												<div class="layout-slider" style="width: 100%">
											      	<span style="display: inline-block; width: 300px; padding: 0 5px;">
											      		<input id="Slider1" type="slider" name="progress" value="${requestScope.task.progress}" />
											      	</span> 
											    </div>
										    </div>
										</div>
									</c:when>
									<c:otherwise>
										<input type="hidden" name="progress" value="${requestScope.task.progress}">
										<div class="control-group">
											<div style="margin-left:90px;">当前进度: <span style="margin-left:20px;">${requestScope.task.progress }%</span></div>
										</div>
									</c:otherwise>
								</c:choose>
							</c:when>
							<c:otherwise>
								<div class="control-group">
									<label class="control-label" for="input01">当前进度:</label>
									<div style="margin-left:20px;">
										<div class="layout-slider" style="width: 100%">
									      	<span style="display: inline-block; width: 300px; padding: 0 5px;">
									      		<input id="Slider1" type="slider" name="progress" value="${requestScope.task.progress}" />
									      	</span> 
									    </div>
								    </div>
								</div>
							</c:otherwise>
						</c:choose>
						
						<div class="form-actions">
							<button id="mybtn" type="submit" class="btn btn-primary">保存</button>
							<button class="btn" onclick="location.back()">返回</button>
					  </div>
						</fieldset>
					</form>
			</div>
		</div>
	</div>
	<script type="text/javascript" charset="utf-8">
      jQuery("#Slider1").slider({ from: 0, to: 100, step: 1, smooth: true, round: 0, dimension: "&nbsp;%", skin: "plastic" });
    </script>
    <script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/select2/select2.min.js"></script>
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function(){
			$(".multiSelect").select2();
			var r=$("#Slider1").attr("value");
		});
	</script>
</body>
</html>